package com.indexingsystem.system.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.indexingsystem.boss.Vo.GetTaskThemeTableListReqVo;
import com.indexingsystem.boss.admin.mapper.IdxTaskThemeTableMapper;
import com.indexingsystem.boss.common.PagedResult;
import com.indexingsystem.boss.entity.IdxTaskThemeTable;
import com.indexingsystem.boss.utils.BeanUtils;
import com.indexingsystem.system.service.IdxTaskThemeTableService;
@Service
public class IdxTaskThemeTableServiceImpl  implements IdxTaskThemeTableService{
	@Resource
	private IdxTaskThemeTableMapper idxTaskThemeTableMapper;
	@Override
	public int deleteByPrimaryKey(String id) {
		// TODO Auto-generated method stub
		return idxTaskThemeTableMapper.deleteByPrimaryKey( id );
	}

	@Override
	public int insert(IdxTaskThemeTable record) {
		// TODO Auto-generated method stub
		return idxTaskThemeTableMapper.insert( record );
	}

	@Override
	public int insertSelective(IdxTaskThemeTable record) {
		// TODO Auto-generated method stub
		return idxTaskThemeTableMapper.insertSelective( record );
	}

	@Override
	public IdxTaskThemeTable selectByPrimaryKey(String id) {
		// TODO Auto-generated method stub
		return idxTaskThemeTableMapper.selectByPrimaryKey( id );
	}

	@Override
	public int updateByPrimaryKeySelective(IdxTaskThemeTable record) {
		// TODO Auto-generated method stub
		return idxTaskThemeTableMapper.updateByPrimaryKeySelective( record );
	}

	@Override
	public int updateByPrimaryKey(IdxTaskThemeTable record) {
		// TODO Auto-generated method stub
		return idxTaskThemeTableMapper.updateByPrimaryKey( record );
	}

	@Override
	public PagedResult<IdxTaskThemeTable> getTaskThemeTableList(GetTaskThemeTableListReqVo getTaskThemeTableListReqVo) {
		 Integer pageNo = getTaskThemeTableListReqVo.getPageNo() == null ? 1 : getTaskThemeTableListReqVo.getPageNo();
	        Integer pageSize = getTaskThemeTableListReqVo.getPageSize() == null ? 10 : getTaskThemeTableListReqVo.getPageSize();
	        // startPage是告诉拦截器说我要开始分页了。分页参数是这两个。
	        PageHelper.startPage( pageNo, pageSize );
	        return BeanUtils.toPagedResult( idxTaskThemeTableMapper.getTaskThemeTableList( getTaskThemeTableListReqVo ) );
	}

	@Override
	public Integer getTaskThemeTableListCount(GetTaskThemeTableListReqVo getTaskThemeTableListReqVo) {
		return idxTaskThemeTableMapper.getTaskThemeTableListCount( getTaskThemeTableListReqVo );
	}

}
